<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>节点</title>
    <style>
        *{
            padding:0;
            margin:0;
            font: 16px "Microsoft Yahei";
            color:#ffaa20;
        }
        .container{
            width:60%;
            height:600px;
            background:rgba(160,200,20,0.3);
            text-align:center;
            margin:20px auto;
        }
    </style>
</head>
<body>
    <div class="container">
        <p>123456</p>
        <span>1大大</span>
        <span>2大大</span>
        <span>3大大</span>
        <span>4大大</span>
        <span>5大大</span>
    </div>
</body>
<script>
    var big = document.documentElement;
    console.log(big);    //获取文档最外层，即html
    var p = document.getElementsByTagName("p")[0];            //p是一个集合，所以必须加上下标，获取具体第几个元素
    console.log(p.innerHTML);                                //获取p标签子内容，包括p标签本身，此时p标签相当于文本类型
    console.log(p.innerText);                               //获取p标签文本内容，不包括p标签本身
</script>
</html>